
             
/**
 * 
 *
 * @File name:  UpdateTFixedAssetsAction.java   修改【资产基本信息:T_FIXED_ASSETS】
 * @Create on:  2011-10-31 17:00:991
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        

package com.boho.estates.assetsbase.action;

            
import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.po.POUtils;
import cn.boho.framework.service.MessageService;

import com.boho.common.SystemUtils;
import com.boho.estates.po.TFixedAssetsPO;
            
        
public class UpdateTFixedAssetsAction extends ActionImp {
	private TFixedAssetsPO conditionTFixedAssetsPO = new TFixedAssetsPO();
	private TFixedAssetsPO valueTFixedAssetsPO = new TFixedAssetsPO();
	private Connection con=null;
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1002", MessageService.getMessage("BOHO_COMMON_1002"),"【资产基本信息】" ,ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		POUtils.update(con, conditionTFixedAssetsPO, valueTFixedAssetsPO,false);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		String updateBy = SystemUtils.getSessionUser(atx);
		conditionTFixedAssetsPO.setFixedAssetsNo(atx.getIntegerValue("FIXED_ASSETS_NO",-1));
		valueTFixedAssetsPO.setFixedAssetsName(atx.getStringValue("FIXED_ASSETS_NAME"));
		valueTFixedAssetsPO.setFixedAssetsType(atx.getStringValue("FIXED_ASSETS_TYPE"));
		valueTFixedAssetsPO.setBrand(atx.getStringValue("BRAND"));
		valueTFixedAssetsPO.setFixedAssetsNature(atx.getStringValue("FIXED_ASSETS_NATURE"));
		valueTFixedAssetsPO.setRemark(atx.getStringValue("REMARK"));
		valueTFixedAssetsPO.setUpdateDate(new java.util.Date());
		valueTFixedAssetsPO.setUpdateBy(updateBy);
		return 1;
	}
}
